home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 003 (1987-02-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 003 (1987-02-15)(Ossowski, Stefan)(DE)(PD).adf / BlackBook / blkbook.doc < prev    next >
Text File  |  1987-03-04  |  5KB  |  175 lines

  1.  
  2.                   ------------------------------------
  3.                   *** Little Black Book © 1987 Lcc ***
  4.                   ------------------------------------
  5.  
  6.    This program is presented in the spirit of keeping shareware alive.
  7.  
  8.    You may freely copy and distribute, for non-commercial purposes, both
  9. Little Black Book and the limited file handler library (bfile.lib) provided
  10. that this documentation accompanies the programs and that no charge is made
  11. for copying and distribution.
  12.  
  13.    If you find these programs useful please send your contribution to the
  14. address below.  If you desire the full-blown bfile library on disk complete
  15. with source code (bfile is written in 'C' and is not Amiga specific) -
  16.  
  17.                 Please send the nominal fee of $30¹ to:
  18.  
  19.                           Craig Nelson
  20.                           Log Cabin Computer
  21.                           921 Arcola Ct PP
  22.                           Granbury, TX  76048
  23.  
  24.  ¹ A bona fide job offer may be substituted for cash as this programmer is
  25.    currently unemployed (817) 573-7304.
  26.  
  27.  
  28.                        Notes, caveats and stuff
  29.                       --------------------------
  30.  
  31. Little Black Book:
  32. ------------------
  33.  * Because of special keyboard/mouse handling, runs only under WorkBench
  34.    release 1.2 (this does not apply to bfile.lib) 
  35.  
  36.  * Set up for 80 column because that's my preference
  37.  
  38.  * If the display flashes it's either your imagination or the beginning or
  39.    end of file has been reached
  40.  
  41.  * For the most part, either the keyboard or the mouse may be used
  42.    interchangeably - you'll get the idea just by playing around
  43.  
  44.    <Right Mouse>     move pointer to the bottom of window
  45.  
  46.    <RETURN>          when the pointer is at the bottom of window enters
  47.                      edit mode
  48.  
  49.    <CTRL><RETURN>    exits edit mode
  50.  
  51.    <Right AMIGA><Q>  restores a field
  52.  
  53.    <Right AMIGA><X>  clears a field
  54.  
  55.    <Right Cursor>    next record
  56.  
  57.    <Left Cursor>     previous record
  58.  
  59.    F1 - 'FND'        finds the first occurence > or = to entry typed
  60.                      (the record key is upper case so 'johnson' = 'JOHNSON')
  61.  
  62.    F2 - 'SAV'        saves changes made to an existing record
  63.  
  64.    F3 - 'ADD'        adds a new record
  65.  
  66.    F4 - 'DEL'        deletes a record
  67.  
  68.  
  69. bfile.lib:
  70. ----------
  71.  * bfile.lib is a B+ tree ISAM file handling package written in 'C'
  72.  
  73.  * The limited version has the following restrictions:
  74.  
  75.    - 1 data file
  76.    - Max record length = 512 bytes
  77.    - Max number of entries = 32K
  78.  
  79.    - 1 index file
  80.    - Max key length = 32 bytes
  81.  
  82.    - provides only limited error checking
  83.  
  84.  * A brief synopsis of the supported functions is as follows:
  85.  
  86.    Given -
  87.            typedef  char  BFILE[100];
  88.  
  89.            external int   BFILE_OK;
  90.  
  91.                     BFILE DataFile, IndexFile;
  92.                     char  FileName[], RecordBuffer[], RecordKey[];
  93.                     int   RecordLength, RecordNumber, KeyLength, Duplicates;
  94.  
  95.  * Create a new data file
  96.  
  97.            MakeFile(&DataFile,&FileName,RecordLength);
  98.  
  99.  * Open an existing data file
  100.  
  101.            OpenFile(&DataFile,&FileName,RecordLength);
  102.  
  103.  * Close a data file
  104.  
  105.            CloseFile(&DataFile);
  106.  
  107.  * Add a new data record
  108.  
  109.            AddRec(&DataFile,&RecordNumber,&RecordBuffer);
  110.  
  111.  * Delete a data record
  112.  
  113.            DeleteRec(&DataFile,RecordNumber);
  114.  
  115.  * Read a data record
  116.  
  117.            GetRec(&DataFile,RecordNumber,&RecordBuffer);
  118.  
  119.  * Write a data record
  120.  
  121.            PutRec(&DataFile,RecordNumber,&RecordBuffer);
  122.  
  123.  * Return the total number of records in a file (including deleted records)
  124.  
  125.            FileRecs(&DataFile);
  126.  
  127.  * Return the total number of records in a file that are in use
  128.  
  129.            UsedRecs(&DataFile);
  130.  
  131.  * Create a new index file
  132.  
  133.            MakeIndex(&IndexFile,&FileName,KeyLength,Duplicates);
  134.  
  135.  * Open an existing index file
  136.  
  137.            OpenIndex(&IndexFile,&FileName,KeyLength,Duplicates);
  138.  
  139.  * Close an index file
  140.  
  141.            CloseIndex(&IndexFile);
  142.  
  143.  * Add a key to an index file
  144.  
  145.            AddKey(&IndexFile,RecordNumber,&RecordKey);
  146.  
  147.  * Delete a key from an index file
  148.  
  149.            DeleteKey(&IndexFile,&RecordNumber,&RecordKey);
  150.  
  151.  * Reset an index file to the beginning
  152.  
  153.            StartKey(&IndexFile);
  154.  
  155.  * Return the key and record number that exactly matches the specified key
  156.  
  157.            FindKey(&IndexFile,&RecordNumber,&RecordKey);
  158.  
  159.  * Return the key and record number that is < or = to the specified key
  160.  
  161.            SearchKey(&IndexFile,&RecordNumber,&RecordKey);
  162.  
  163.  * Return the next key and record number
  164.  
  165.            NextKey(&IndexFile,&RecordNumber,&RecordKey);
  166.  
  167.  * Return the previous key and record number
  168.  
  169.            PrevKey(&IndexFile,&RecordNumber,&RecordKey);
  170.  
  171.    (Most functions set BFILE_OK to TRUE if no error occurred and FALSE if
  172.    there was an error)
  173.  
  174.                                - - -
  175.